//
//  HotViewModel.swift
//  shop
//
//  Created by chen on 2025/5/17.
//

import SwiftUI

@MainActor
class HotViewModel: ObservableObject {
    
    static let shared: HotViewModel = HotViewModel()
    
    public init() {}
    
    @Published var goodsResp: GoodsItemResp = GoodsItemResp()
    
    @Published var lastId: String = ""
    
    public func getGoodsList() {
        Task{
            let queryParam: [String:Any] = [
                "version": "v1.0.0",
                "pageId": "1",
                "pageSize": 50
            ]
            
            await NetManager.shared.httpGet(.explosiveGoodsList, queryParam: queryParam) { (resp: GoodsItemResp) in
                self.goodsResp.list = resp.list
            }
        }
    }
}
